The present invention relates to join processors for joining relations based on join fields of relational databases.
A conventional join processor for relational data bases such as shown in J. D. Ullman, "Principles of Database Systems," Computer Science Press Inc., Sec. 8.1 (p. 328, line 5 to p. 331, line 6 in the Japanese version translated by Kunii, T. and Ookubo, N. and published by Nippon Computer Institute) is shown in FIGS. 5A and 5B. The join processor includes a computer 24 and a disk unit 25 which is connected to the computer 24. A pair of relations 5 and 6 are stored in the disk unit 25. Each record of the relation 5 or 6 has a join field 7 or 8 and an address 11 or 12. In the computer 24 there are a pair of address tables 15 and 16, each of which consists of the join field 7 or 8 and the record address 11 or 12 which are extracted from the relations 5 and 6 and sorted according to the values of the join fields 7 and 8 (or arranged in the order of increasing numbers). An address table 17 or 18 has only the addresses 11 or 12 of the records which meet the join (correspondence) conditions determined by comparison between the join fields 7 and 8 in the address tables 15 and 16. A record set 21 or 22 has records which are extracted from the relation 5 or 6 so as to meet the join conditions. A record set 23 contains the results of a join process.
In such a relational database, all data are managed in the form of a table which is called a "relation." Each relation is composed of a plurality of fields in which attribute information is described. The join process is a process by which a set of records having the equal join field values in a plurality of relations is determined, and the necessary fields are extracted from the set to provide attribute information over the relations.
For example, how to join two relations will be described with reference to FIG. 6. The "employee" relation 5 has an "employee name" field and a "title number" field. The "title" relation 6 has a "title number" field and a "title" field. When the full name and the title of an employee having a family name "Tanaka" are extracted from these two relations 5 and 6, it is necessary to join the relations 5 and 6 according to the join fields 7 and 8 or "title number."
First, a target value of "employee's name" or "Tanaka" is inputted to the computer 24 (Step S.sub.1). Then, the computer 24 extracts from the relation 5 in the disk unit 25 the values of the join field 7 and the addresses 11 of records having a character string "Tanaka" in the employee name field (or 1001, 1004, 1005, and 1008) and sorts them in the order of increasing values of the join field 7 to provide an address table 15 (Step S.sub.2). Similarly, the computer 24 extracts from the relation 6 in the disk unit 25 the values of the join field 8 and the record addresses 12 and sorts them in the order of increasing values of the join field 8 to provide an address table 16 (Step S.sub.3).
Then, the join fields 7 and 8 of the address tables 15 and 16 are compared to extract the record addresses 11 and 12 of records which meet the join conditions or have equal join field values in the address tables 15 and 16 (1005, 1001, 1008, and 1004 of the address table 15 and 2002, 2004, and 2001 of the address table 16), thus producing address tables 17 and 18 (Step S.sub.4).
Then, the necessary fields of records having the records addresses in the address tables 17 and 18; namely, the employee name field of the relation 5 and the title field of the relation 6, are read from the relations 5 and 6 to provide two sets of records 21 and 22 which meet the join conditions (Step S.sub.5). Finally, comparing the join fields 7 and 8 of the record sets 21 and 22 provides the final join results 23 (Step S.sub.6).
In such a join processor where at only a single processor performs the above process, the number of process steps increases with the size of relations to be joined Consequently, it has been difficult to provide a fast join processor for a large size of relations.